/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: HP
 * Date: 2023 -04 -29
 * Time: 23:38
 */

public class Oval extends GeoGraph{

    private int a;
    private int b;
    public Oval(){};
    public Oval(int a,int b) {
        this.a = a;
        this.b = b;
    }

    public double getArea() {
        return 2*Math.PI*b + 4*(a-b) ;
    };

    public double getPerimeter() {
        return Math.PI*a*b;
    };

    public String toString() {
        return ("椭圆的面积是：  "+getArea());
    }

}

